package com.meilai.project.controller.web.adMake.service;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.meilai.project.controller.web.adMake.entity.BillAdMakePic;
import com.meilai.project.controller.web.adMake.mapper.BillAdMakePicMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <p>
 * 制作单-画面 服务实现类
 * </p>
 *
 * @author 张驰
 * @since 2022-08-16
 */
@Service
public class BillAdMakePicServiceImpl extends ServiceImpl<BillAdMakePicMapper, BillAdMakePic> implements BillAdMakePicService {

    @Transactional
    @Override
    public void deleteByAdMakeId(Long adMakeId) {
        LambdaQueryWrapper<BillAdMakePic> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(BillAdMakePic::getBill_ad_make_id, adMakeId);
        remove(wrapper);
    }

    @Override
    public List<BillAdMakePic> picVOListByAdMakeId(Long adMakeId) {
        LambdaQueryWrapper<BillAdMakePic> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(BillAdMakePic::getBill_ad_make_id, adMakeId);
        return list(wrapper);
    }
}
